package com.yc.snacknet.controller;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000117641328";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDUHNnKguKdEnekVa8bItRJbdc0D5QQ9yiIhQN6KNNyGhBb1mZDm/5H/geLlKmHygPZb/dKFU2U6H2pXFQh7ZYre2xInP9rF3P2WoQa7k4nYVwVligMtC3qyeJzeOPZvsluoC7Wyoe9P06gUWOw3cTu+O6aklIl/4pg+vhP3mDuEd83QBo0iR00yuZe2YWOJR0bIQrMvn2dXz3CnunLQ7LBccRDeYZ/Uxte2sGUBDgAePMX+ARUa9hLNQJvWXdwI9Yjz21f06nRidB0ueTq91ir7wJ6xwT9D8/hcvX+UwElsjdEtDEFMYjAU8xQ6KZK1dX3MGeIfbY8HIAXT1epBJefAgMBAAECggEAcLz44RMaAWQ8ZQMJtAGaFYElHc2d5DqJt64DAB3M7Nt/kGBvMEYsK/WP6xdT2BF+ZEaHiD+0YY4EpEynhvTxmSDbl+iiNThc8TaA+pNoxLORrwOFO+NUeHNfQgKiECzAgWTwIEe7R9HrJ3i65Nmqf12d7FgTA5FD6nHaIxFOMZojm7m0lwJMWM57DqtYWq2kv74hmpL/R4Hui7YT+VWsJuvStuXfq3uQV1wLkxFsH6wetch1c6AOruhKnqnsMQ4tFCyUSegXgp8/ItWSXD9WCOkuwoMRCO2lebbTKMoW1WP4zLXuBfS65JPZJb7T5O0fIr/rV7P6XFxonJ1FYfI18QKBgQD9I3O+9x5RIT74UUolZFS+MiEqIS+x6JlQ90//kbswMGd5+iuIoN0/yN4Fdry6KDsuBcWNvAOm9C7hnJSetrlU68gMtAtuZ9mjNUDbu5o/SkCWAsEY14SGSvz51FmZ7SJ6Oy5mvdckOpP0hpIn7wXuzl+4jzgXqaQcUxRMc9B3KQKBgQDWgqz3CnrJaGOIEJ1LjjppUkPiz5v7Rlj6T+/8VJxhDJU/P+pLJRI9E1tlHKWxtVhC7A9iEWcrPX/0Xg6mW/0FPXSE+wjnQAqL0Z3n+YCjd3w65HEq41uwqOXwSk1db3hMyRfD06szLTiSoOyogGtMFstNlxjROo8bVMVunvTZhwKBgQCFt4N93dYS7yfvTimHpP8q1Ro1wgAKz56laW7FxvqFkxwmD+ONMcSN3BKD+lvpTjUss3nOzAF14Mke/nJ3gHhYBpDPPRBIyuzpTMktCWWKhzOkymGsOLRVqCkH44dNSzmKLdbuCNwr1BGx+qAcHiQZKMThni34OfFp0O0JEaiOOQKBgHU/7CcENWVNh8nhuviHf2n+K1kYPZw1MYFwnC6CWQ+6/wEZgIkedD+qCvTTmcXu55V8zlO+S3QZI42As+U+tqhclQny5UTxflI6e2NGv4eaUe8m2qykpYOEblrPYkZGHa1q5XCGjDdm6ltLVtArkXp/oxSAGHKU3ZAE3/29KPyVAoGAF+TabxwOcvMc/hwDLwSJze82CifRdnHJPtXjNkqYhm5m6iNBm0ryyZcbpq8ZsA6UsRM06SH/kjBh7ZNM7MrWo6AEU6vd0Ee3eKOSdM5hXsXUoVDo5FJxmTNO5JJcxZ/3Iyiq7N2kOrInlPG4/ICxR2WZ+m4K0CjW2bJPm34kZus=";
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxlzpiz+kzs7jwzLwuSRj6lXfkdS1LwQrXpqLcrnPvwmz2e0Zoh7az15/h3Yh+ovLe4xWCRHzZg472mdqp5FHq3Ru4eQ5smdTeR50MEeAjLRFcXngzl+RpXN4sO5GZPsOz/H+X7HRBYcf6LI/6slJdpVO7N095yoNzTXg/VV4MA4CJ0ItCGp5gnItITB2mN0ETzlThhqn6h+epBTMoSHcuVwwTwg1mHwj/qhUiFAP5kx5St2NxPf2RP2HvPIEERieAFrn1IfS775wt1VEqePK7jA8TX2lS1WC/XWeJZlgIPr/YDgd0uQo96cFrJ6lEuc5OIH4ot21dwg0vTOSDeQ36QIDAQAB";
	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/snack-ssm/order/alipay/notify_url";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/snack-ssm/order/alipay/return_url";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

